package com.yunweiweishi.xuhuanpaltform.yuhuan_app.service.imp;

import com.yunweiweishi.xuhuanpaltform.yuhuan_app.dao.FlightsTaskDao;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.pojo.FlightsTask;
import com.yunweiweishi.xuhuanpaltform.yuhuan_app.service.FlightsTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
@Transactional
public class FlightsTaskServiceImpl implements FlightsTaskService {


    @Autowired
    private FlightsTaskDao flightsTaskDao;


    /**
     *
     * 添加班次任务
     * @param flightsTask
     */
    @Override
    public void addFlightsTask(FlightsTask flightsTask) {
        flightsTaskDao.save(flightsTask);

    }



    /**
     *
     * 更新班次任务
     * @param flightsTask
     */
    @Override
    public void updateFlightsTaskById(FlightsTask flightsTask) {
        flightsTaskDao.save(flightsTask);

    }


    /**
     *
     *
     * @param id
     */
    @Override
    public void deleteFlightsTaskById(Long id) {
        flightsTaskDao.deleteById(id);

    }

//    @Override
//    public FlightsTask findFlightsTaskByName(Long userId, Long flightsId, Date startTime, Date endTime) {
//        return flightsTaskDao.findFlightsTaskByName(userId,flightsId,endTime);
//    }


    /**
     * 发现全部的任务
     * @return
     */
    @Override
    public List<FlightsTask> FindAllList() {
        return flightsTaskDao.findAll();
    }


}
